package com.cli.util;

import org.apache.commons.lang3.StringUtils;

/**
 * @Author xiongmin
 * @Description
 * @Date 2021/2/2 11:54
 * @Version 1.0
 * @TODO
 **/
public class FileUtil {

    private final static String DOC = "doc";
    private final static String DOCX = "docx";
    private final static String XLS = "xls";
    private final static String XLSX = "xlsx";

    public static boolean isWord(String filePath) {
        if (StringUtils.isBlank(filePath)) {
            return false;
        }
        if (filePath.endsWith(DOC) || filePath.endsWith(DOCX)) {
            return true;
        }
        return false;
    }

    public static boolean isExcel(String filePath) {
        if (StringUtils.isBlank(filePath)) {
            return false;
        }
        if (filePath.endsWith(XLS) || filePath.endsWith(XLSX)) {
            return true;
        }
        return false;
    }
}
